﻿using System.Collections.Generic;

namespace Bioinformatics.Types
{
    /// <summary>
    /// Represents a collection of timings taken for a single benchmark.
    /// </summary>
    public class BenchmarkLog
    {
        /// <summary>
        /// Creates a new instance of BenchmarkLog class with no values contained in log.
        /// </summary>
        public BenchmarkLog()
        {
            Values = new List<BenchmarkEntry>();
        }

        /// <summary>
        /// Gets or sets the log values for the current <see cref="BenchmarkLog"/>
        /// </summary>
        public List<BenchmarkEntry> Values { get; set; }

        /// <summary>
        /// Adds a single entry into the current log.
        /// </summary>
        /// <param name="time">The time taken to process the entire swarm.</param>
        /// <param name="swarmSize">The size of the swarm the benchmark was run with.</param>
        public void AddEntry(float time, int swarmSize)
        {
            Values.Add(new BenchmarkEntry {Time = time, SwarmSize = swarmSize});
        }
    }

    /// <summary>
    /// Represents a single benchmark entry.
    /// </summary>
    public class BenchmarkEntry
    {
        /// <summary>
        /// The size of the swarm the benchmark was run with.
        /// </summary>
        public int SwarmSize { get; set; }

        /// <summary>
        /// The time taken to process the entire swarm.
        /// </summary>
        public float Time { get; set; }
    }
}